package gui;

import core.para.Para;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.*;

/*Author: John Archer, Contact: john.archer.jpa@gmail.com*/
public class VTL0 extends JFrame{
    private VTL1 vtl1;
    private static Menu menu;
    public VTL0(){
        super("VTBuilder");
        this.setLocation(Para.X_AND_Y_APP_LOC, Para.X_AND_Y_APP_LOC);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(996, 668);
        this.setResizable(false);
        vtl1 = new VTL1(this);
        menu = new Menu(vtl1);
        this.setJMenuBar(menu);
        this.addComponentListener(new ComponentAdapter() {
            public void componentMoved(ComponentEvent e) {
                try{
                VTL0.updateJWinLocs(
                        Run.vtl0.getLocation().x, 
                        Run.vtl0.getLocation().y + 40
                        );
                }catch(Exception ex){}
            }
        });
        this.setContentPane(vtl1);
        this.setVisible(true);
    }
    private static void updateJWinLocs(int x, int y){menu.updateJWinLocs(x, y);}
}